package com.xqls.server.dto;

import com.xqls.server.dto.recive.*;
import com.xqls.server.dto.send.SamplingSetDto;
import com.xqls.server.dto.send.SwitchValveDto;

/**
 * Created by Skeyedu on 2017/3/9.
 */
public enum DtoEnum {

    SAMPLING_DTO("c9","采样仪采样记录", SamplingDto.class),
    SAMPLING_REALTIME_DTO("c8","水质因子实时值", SamplingRealTimeDto.class),
    SAMPLING_SET_DTO("ca","采样仪采样设置", SamplingSetDto.class),
    SAMPLING_SETBACK_DTO("cd","采样仪返回", SamplingSetBackDto.class),
    SWITCH_VALVE__DTO("ea","阀门控制仪开关阀", SwitchValveDto.class),
    SWITCH_VALVE_BACK_DTO("eb","阀门控制仪开关阀返回", SwitchValveBackDto.class),
    CONTROL_APPARATUS_DTO("ef","阀门控制仪实时状态",ControlApparatusDto.class)
    ;

    private DtoEnum(String code, String msg,Class clss) {
        this.code = code;
        this.msg = msg;
        this.clss=clss;
    }

    private String code;
    private String msg;
    private  Class clss;

    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    public String getMsg() {
        return msg;
    }
    public void setMsg(String msg) {
        this.msg = msg;
    }

    public static DtoEnum find(String code){
        for(DtoEnum dtoEnum:  DtoEnum.values()){
            if(dtoEnum.code.equals(code)){
                return dtoEnum;
            }
        }
       return  null;
    }

    public Class getClss() {
        return clss;
    }

    public void setClss(Class clss) {
        this.clss = clss;
    }
}
